package org.genntii.warehousesystem.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.genntii.warehousesystem.domain.entity.GoodsOrder;

import java.util.List;

@Mapper
public interface GoodsOrderMapper extends BaseMapper<GoodsOrder> {

    @Update("update goods_order set status = #{status} where id = #{id}")
    void updateStatus(@Param("status")int id, @Param("id")int status);

    @Select("select * from goods_order where user_id = #{userId} limit #{page},10")
    List<GoodsOrder> selectOrderByPage(@Param("userId")int userId,@Param("page") int page);

    @Select("select * from goods_order where warehouse_id = #{warehouseId} limit #{page},10")
    List<GoodsOrder> selectOrderByPageForWarehouse(@Param("warehouseId")int warehouseId,@Param("page")int page);
}
